/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-08-14 09:59:57
 * @LastEditors: liuxinjia 15201611813@163.com
 * @LastEditTime: 2023-08-16 14:58:25
 * @FilePath: \MashangqianWebByBank\src\main.js
 * @Description: 默认main.js
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
// import './elmentColor/index.css'
import '@/theme/theme/index.css'
import http from './api/http'
import Print from 'vue-print-nb'
import global_ from './config/global'
import htmlToPdf from './utils/htmlToPdf'
import JsEncrypt from 'jsencrypt' // 加密

// 引入公共iconfont
import './assets/iconfont/iconfont.css'

// 引用公共表单校验
import validate from '@/utils/validate.js'
Vue.prototype.$rules = validate

// 引入用公共分页组件
import Pagination from '@/components/Pagination'
Vue.component('pagination', Pagination)

// 引用公共上传组件
import Upload from '@/components/upload'
Vue.component('upload', Upload)

// 注册全部面包屑导航
import MyBreadcrumb from '@/components/myBreadcrumb'
Vue.component('my-breadcrumb', MyBreadcrumb)

//  全局注册loading加载
Vue.prototype.openLoading = function() {
  const loading = this.$loading({           // 声明一个loading对象
    lock: true,                             // 是否锁屏
    text: '加载中',                         // 加载动画的文字
    spinner: 'el-icon-loading',             // 引入的loading图标
    background: 'rgba(0, 0, 0, 0.7)',       // 背景颜色
    // target: '.el-table, .table-flex, .region',       // **需要遮罩的区域，这里写要添加loading的选择器**
    // fullscreen: false,
    // customClass: 'loadingclass'             // **遮罩层新增类名，如果需要修改loading的样式**
  })
  setTimeout(function () {                  // 设定定时器，超时5S后自动关闭遮罩层，避免请求失败时，遮罩层一直存在的问题
    loading.close();                        // 关闭遮罩层
  },5000)
  return loading;
}



// 注册上传url前缀
Vue.prototype.$rootUrl="https://api.yoojet.com"

Vue.prototype.$JsEncrypt = JsEncrypt
Vue.prototype.$baseUrl = global_.BASE_URL
Vue.prototype.$http = http
Vue.config.productionTip = false
// 需要添加Vue.config.devtools = true;  浏览器才会显示vue-devtools插件
Vue.config.devtools = true;

// console.log = function () {}

Vue.use(Print)
Vue.use(ElementUI)
Vue.use(htmlToPdf)
new Vue({
  router,
  render: (h) => h(App),
}).$mount('#app')
